package com.hyt.it.ogt.pj.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.pj.model.entity.ItemScore;
import com.hyt.it.ogt.pj.model.vo.ItemScoreVo;

/**
 * <p>
 * 题目分数表 Mapper 接口
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface ItemScoreMapper extends BaseMapper<ItemScore> {

    void deleteByProjectId(@Param("projectId") String projectId);

    List<ItemScoreVo> getStudentItemScore(@Param("projectId") String projectId, @Param("admissionNum")String admissionNum);
    
    List<ItemScoreVo> getStudentItemScoreByCurrUserId(@Param("projectId") String projectId, @Param("admissionNum") String admissionNum, @Param("currUserId") String currUserId);
    
    List<ItemScoreVo> getStudentItemScoreByItemId(@Param("itemId") String itemId, @Param("taskIds") List<String> taskIds, @Param("userId") String userId );
    /**
     * 根据taskid和encodeid删除考生评分
     * @param taskId
     * @param encodeId
     */
    void deleteStudentScoreByTaskIdAndEncodeId(@Param("taskId")String taskId,@Param("encodeId") String encodeId);
    
    /**
     * 根据taskid和encodeid和userid删除考生评分
     * @param taskId
     * @param encodeId
     * @param userId
     */
    void deleteStudentScoreByTaskIdAndEncodeIdAndUserId(@Param("taskId")String taskId,@Param("encodeId") String encodeId, @Param("userId") String userId);

    /**
     * 删除考生小题分数
     * @param admissionNumList 准考证号
     * @param needRemoveTaskIdList 评卷任务id
     * @param itemIdList 试题id
     * @return 是否成功
     */
    boolean removeItemScore(List<String> admissionNumList, List<String> needRemoveTaskIdList, List<String> itemIdList);

    /**
     * 查询需要被删除的试题id
     * @param admissionNumList 准考证号
     * @param needRemoveTaskIdList 评卷任务id
     * @return 需要被删除的试题id
     */
    List<String> selectItemId(List<String> admissionNumList, List<String> needRemoveTaskIdList);

    


    void updateItemScoreByUserId( @Param("ids") List<String> ids,@Param("currUserId") String currUserId);

    void updateItemScoreFinish( @Param("ids") List<String> ids,@Param("currUserId") String currUserId);

    List<ItemScoreVo> getStudentItemScores( @Param("projectId") String projectId, @Param("admissionNums") List<String> admissionNums, @Param("currUserId") String currUserId);
}
